-
Notifications
You must be signed in to change notification settings - Fork 0
Virtual Altimeter base code + initial tests #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
daftcube
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
| }; | ||
|
|
||
| void VirtualBarometer::process(double deltatime) { | ||
| std::cout << "PROCESSING NEW POSITION" << '\n'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing debug std::cout prints and instead either:
- Print to file
- Write function that prints state of barometer every simulation tick, and call that in simulate loop
|
|
||
| void VirtualBarometer::process(double deltatime) { | ||
| std::cout << "PROCESSING NEW POSITION" << '\n'; | ||
| position_provider.process(deltatime); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you folks are changing the architecture, but you probably want to call position_provider.process(deltatime) in the main simulation loop as a first step, then call VirtualBarometer::process() after it. This prevents coupling that is present here.
| VirtualBarometer(unsigned int rs, double alt, double ns); | ||
| double get_reported_altitude(); | ||
| void process(double); | ||
| PhoenixPositionProvider position_provider; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a pointer to position_provider. Currently, it is declared as a unique instance that is a member of this class. Consider change to PhoenixPositionProvider* position_provider.
| }else { | ||
| fs.process(solenoid_timer, target); | ||
| } | ||
| }()); // make sure to actually call lambda function immediately lolz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lolz
| CHECK_THROWS_AS(fs.process(solenoid_timer, target), std::runtime_error); | ||
| } | ||
|
|
||
| TEST_CASE("Process Loop Run Explode", "Engine explodes cuz someone closed solenoid while it was running") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Engine will probably not explode if this happens, it will probably just sputter out. Check w/ Fluid Systems and/or Prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great tests, especially checking for determinism!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look good, but check with someone more familiar with the vehicle, I have been retired for a while.
Resolves #6. Finished virtual altimeter initial tests